﻿@model PhoneBilling.Models.GradeDetailMgtModel
@{
    ViewBag.Title = "收费等级管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
    function changeGrade() {
        window.location.href = "/Manage/GradeDetailMgt/" + $("#gradeList").val();
    }
    function del(id, name,grade) {
        var r = confirm("确认删除话类：" + name + "吗？");
        if (r == true) {
            window.location.href = "/Manage/GradeDetailDelete?areaType=" + id + "&gradeID=" + grade;
        }
        return false;
    }
</script>
@if (Model.Message != null){<h2>@Model.Message</h2>}
<p id="btn-create" class="box">当前收费等级表: @Html.DropDownListFor(m => m.CurrentGrade, new SelectList(Model.GradeList, "ID", "Name"), new { id = "gradeList", style = "input-text", onchange = "changeGrade()" }) <a href=@string.Format("{0}?gradeID={1}", "/Manage/GradeDetailEdit", Model.CurrentGrade)><span>新增收费等级表明细</span></a><span>   </span><a href=@string.Format("{0}?gradeID={1}", "/Manage/GradeDetailMonthEdit", Model.CurrentGrade)><span>月租设定</span></a></p>
<div>
    @Html.LabelFor(m => m.月租费)
    @Html.DisplayFor(m => m.月租费)
    @Html.LabelFor(m => m.功能费)
    @Html.DisplayFor(m => m.功能费)
    @Html.LabelFor(m => m.代维费)
    @Html.DisplayFor(m => m.代维费)
    @Html.LabelFor(m => m.免费额)
    @Html.DisplayFor(m => m.免费额)
    @Html.LabelFor(m => m.其他费)
    @Html.DisplayFor(m => m.其他费)
</div>
@{
    var grid = new WebGrid(source: Model.GradeDetailList, rowsPerPage: 30);
}
@grid.GetHtml(
    alternatingRowStyle: "bg",
    columns:grid.Columns
    (
        grid.Column("话类", "话类"),
        grid.Column("最小计费延时", "最小计费延时"),
        grid.Column("时长误差", "时长误差"),
        grid.Column("最小计次次数", "最小计次次数"),
        grid.Column("服务费缩放系数", "服务费缩放系数"),
        grid.Column("附加费按基本费的比例收取时的系数", "附加费/基本费"),
        grid.Column("服务费按基本费的比例收取时的系数", "服务费/基本费"),
        grid.Column("附加费按服务器的比例收取时的系数", "附加费/服务费"),
        grid.Column("单笔花费最小金额", "单笔最小金额"),
        grid.Column("单笔花费最大金额", "单笔最大金额"),
        grid.Column("包月话类收费起点", "包月收费起点"),
        grid.Column("包月话类封顶限额", "包月封顶限额"),
        grid.Column("取整方法", "取整方法"),
        grid.Column(format: (item) => Html.ActionLink("修改", "GradeDetailEdit", new {gradeID = Model.CurrentGrade, areaType = item.话类 })),
        grid.Column(format: (item) => Html.Raw(string.Format("<a href='javascript:' onclick=\"del('{0}','{1}','{2}')\">删除</a>", item.话类 , item.话类,Model.CurrentGrade)))
    )
)


